<template>
    <div class="container">
        <el-page-header @back="goBack" content="员工列表"></el-page-header>
        <div class="e-m-t-45">
            <el-radio-group v-model="userType">
                <el-radio-button 
                    v-for="item in options"
                    :key="item.value"
                    :label="item.value"
                    >
                    {{ item.label }}
                </el-radio-button>
            </el-radio-group>
        </div>
        <clerkList></clerkList>
    </div>
</template>

<script>

import clerkList from '@/components/clerk-list/clerk-list.vue'
export default {
    layout: 'admin',
    components: {
        clerkList
    },
    head() {
        return {
            title: '员工列表'
        }
    },
    data() {
        return {
            userType: 2,
            options:[
                // {
                //     value: null,
                //     label: '全部'
                // },
                {
                    value: 1,
                    label: '运营商员工'
                },
                {
                    value: 2,
                    label: '加盟商员工'
                }
            ],
        }
    },
    watch: { 
        userType(val){
            if(val == 1){
                this.$router.push('/staff/list')
            }
            if(val == 2){
                this.$router.push('/clerk/list')
            }
        }
    },
    mounted() {

    },
    methods: {
        goBack() {
            this.$router.go(-1)
        }
    }
}
</script>

<style lang="scss" scoped>

</style>